#include <stdio.h>

int removeDuplicates(int *nums, int numsSize)
{
    int n = 1;
    for(int i = 1; i < numsSize; i++)
    {
        if(nums[i] != nums[i - 1])
        {
            nums[n++] = nums[i];
        }
    }
    return n;
}

int main()
{
    int nums[] = {1, 1, 2, 2, 3};
    int numsSize = sizeof(nums) / sizeof(nums[0]);
    int x = removeDuplicates(nums, numsSize);
    for (int i = 0; i < x; i++)
        printf("%d ", nums[i]);
    return 0;
}